aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/(profile)/+layout.server.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-12-29 16:07:47 -0800
committerAdam Soltys <[email protected]>2022-12-29 16:07:47 -0800
commit97c0bf2a15a6570093b326044766d127ba950347 (patch)
tree3406d9706990bf54b2ec86091ab5cf653416b62c /src/routes/(app)/[username]/(profile)/+layout.server.js
parent65c1a7a3113c0fabe67d74f430254845830e1e2f (diff)
downloadcoinos-ui-97c0bf2a15a6570093b326044766d127ba950347.tar.gz
coinos-ui-97c0bf2a15a6570093b326044766d127ba950347.zip
catch follow errors
Diffstat (limited to 'src/routes/(app)/[username]/(profile)/+layout.server.js')
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.server.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.js b/src/routes/(app)/[username]/(profile)/+layout.server.js
index 9cd0870d..f4f2ca0a 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.server.js
+++ b/src/routes/(app)/[username]/(profile)/+layout.server.js
@@ -3,8 +3,20 @@ import { get } from '$lib/utils';
export async function load({ parent }) {
let { subject, user } = await parent();
- subject.follows = await get(`/${subject.pubkey}/follows`);
- subject.followers = await get(`/${subject.pubkey}/followers`);
+ subject.follows = [];
+ subject.followers = [];
+
+ try {
+ subject.follows = await get(`/${subject.pubkey}/follows`);
+ } catch (e) {
+ console.log('problem fetching follows', e);
+ }
+
+ try {
+ subject.followers = await get(`/${subject.pubkey}/followers`);
+ } catch (e) {
+ console.log('problem fetching followers', e);
+ }
if (user) {
user.follows = await get(`/${user.pubkey}/follows?tagsonly=true`);